package com.digitalchina.lxnsy.api;

import android.app.Activity;
import android.os.Handler;

import com.digitalchina.lxnsy.constant.MSG;
import com.digitalchina.lxnsy.constant.URL;
import com.digitalchina.lxnsy.toolkit.OkHttpUtil;
import com.digitalchina.lxnsy.xml.UserXML;
import com.lzy.okhttputils.model.HttpParams;

/**
 * ================================================
 * 项目名称：BigData
 * 类描述：
 * 包名：com.digitalchina.bigdata.api
 * 创建人：郑皓
 * 创建时间：2018/3/14 15:03
 * 修改备注：
 * ================================================
 */
public class BusinessHelpFeedback {


    /**
     * 常见问题列表
     *
     * @param activity
     * @param page
     * @param limit
     * @param handler
     */
    public static void compromanager(Activity activity, int page, int limit, Handler handler) {

        HttpParams params = new HttpParams();
        params.put("page", String.valueOf(page));
        params.put("limit", String.valueOf(limit));

        OkHttpUtil.post(activity, URL.URL_COMPROMANAGER, "", params, handler, MSG.MSG_COMPROMANAGER_SUCCESS, MSG.MSG_COMPROMANAGER_FIELD);

    }


    /**
     * 用户提交反馈
     *
     * @param activity
     * @param fbContent
     * @param imgs      反馈图片(多个图片地址用;隔开)
     * @param handler
     */
    public static void addFeedBack(Activity activity, String fbContent, String imgs, Handler handler) {

        HttpParams params = new HttpParams();
        params.put("userAccId", UserXML.getUserId(activity));
        params.put("fbContent", fbContent);
        params.put("imgs", imgs);

        OkHttpUtil.post(activity, URL.URL_ADD_FEEDBACK, "", params, handler, MSG.MSG_ADD_FEEDBACK_SUCCESS, MSG.MSG_ADD_FEEDBACK_FIELD);

    }


    /**
     * 我的反馈列表
     *
     * @param activity
     * @param page
     * @param limit
     * @param handler
     */
    public static void getMyFBs(Activity activity, int page, int limit, Handler handler) {

        HttpParams params = new HttpParams();
        params.put("userAccId", UserXML.getUserId(activity));
        params.put("page", String.valueOf(page));
        params.put("limit", String.valueOf(limit));

        OkHttpUtil.post(activity, URL.URL_GET_MY_FBS, "", params, handler, MSG.MSG_GET_MY_FBS_SUCCESS, MSG.MSG_GET_MY_FBS_FIELD);

    }


    /**
     * 反馈详情
     * @param activity
     * @param feedBackId
     * @param handler
     */
    public static void getFBInfo(Activity activity, String feedBackId, Handler handler) {

        HttpParams params = new HttpParams();
        params.put("feedBackId", feedBackId);

        OkHttpUtil.post(activity, URL.URL_GET_FB_INFO, "", params, handler, MSG.MSG_GET_FB_INFO_SUCCESS, MSG.MSG_GET_FB_INFO_FIELD);

    }
}
